<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>基本设置</title>
    <!-- 前台公共CSS,JS文件 -->
    <#include "../common/common.ftl"/>
<body>
<div class="container">
    <!-- 头部 -->
    <#include "../../front/common/header.ftl"/>
    <!-- 导航 -->
    <nav class="navbar navbar-inverse" role="navigation">
        <div class="container-fluid">
            <div class="collapse navbar-collapse navbar-collapse-example">
                <!-- 左侧的导航项目 -->
                <ul class="nav navbar-nav navbar-left">
                    <li class="navbar-brand">Java源码网</li>
                    <li class="active"><a href="/">首页</a></li>
                    <li><a href="/source.html">源码</a></li>
                    <li><a href="/blog.html">博客</a></li>
                    <li><a href="/ask.html">问答</a></li>
                    <li>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="">更多 <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="">任务</a></li>
                            <li><a href="">bug</a></li>
                            <li><a href="">需求</a></li>
                            <li><a href="">用例</a></li>
                        </ul>
                    </li>
                </ul>
                <!-- 导航中的表单 -->
                <form class="navbar-form navbar-left" role="search">
                    <div class="form-group">
                        <input id="searchInputExample" autofocus="autofocus" type="search" class="form-control search-input" placeholder="搜索">
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>
                <!-- 右侧的导航项目 -->
                <ul class="nav navbar-nav navbar-right">
                    <#if memberDto?exists>
                        <li class="dropdown">
                            <a href="" class="dropdown-toggle" data-toggle="dropdown">个人中心 <b class="caret"></b></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="/user/main">我的主页</a></li>
                                <li><a href="/user/info">用户中心</a></li>
                                <li><a href="/user/set">基本设置</a></li>
                                <li><a href="/user/mes">我的消息<span class="label label-badge label-success">4</span></a></li>
                                <li><a href="/logout">退出</a></li>
                            </ul>
                        </li>
                    </#if>
                    <#if !memberDto?exists>
                        <li class="dropdown">
                            <a href="/login.html">登录</a>
                        </li>
                        <li class="dropdown">
                            <a href="/register.html">注册</a>
                        </li>
                    </#if>
                </ul>
            </div>
        </div>
    </nav>
    <!-- 内容 -->
    <div class="row">
        <div class="col-xs-4 col-md-3">
            <ul class="nav nav-primary nav-stacked">
                <li><a href="/user/main">我的主页</a></li>
                <li><a href="/user/info">用户中心</a></li>
                <li class="active"><a href="/user/set">基本设置</a></li>
                <li><a href="/user/mes">我的消息</a></li>
            </ul>
        </div>
        <!--侧边栏 -->
        <div class="col-xs-12 col-sm-6 col-md-8">
            <ul class="nav nav-secondary">
                <li class="active"><a href="###" data-target="#tab2Content1" data-toggle="tab">我的资料</a></li>
                <li><a href="###" data-target="#tab2Content2" data-toggle="tab">我的头像</a></li>
                <li><a href="###" data-target="#tab2Content3" data-toggle="tab">我的密码</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane fade active in" id="tab2Content1">
                    <p>
                        <form class="form-horizontal" id="userInfoForm">
                            <input type="hidden" class="form-control" id="id" name="id" value="${member.id!?c}">
                            <div class="form-group">
                                <label for="exampleInputAccount4" class="col-sm-2">账号</label>
                                <div class="col-md-6 col-sm-10">
                                    <input type="text" class="form-control" id="name" name="name" value="${member.name!}" placeholder="账号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="exampleInputAccount4" class="col-sm-2">手机号</label>
                                <div class="col-md-6 col-sm-10">
                                    <input type="text" class="form-control" id="phone" name="phone" value="${member.phone!}" placeholder="手机号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="exampleInputAccount4" class="col-sm-2">邮箱</label>
                                <div class="col-md-6 col-sm-10">
                                    <input type="text" class="form-control" id="email" name="email" value="${member.email!}" placeholder="邮箱">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <button type="button" class="btn btn-primary" id="userInfoButton">确认修改</button>
                                </div>
                            </div>
                        </form>
                    </p>
                </div>
                <div class="tab-pane fade" id="tab2Content2">
                    <p>标签2的内容。</p>
                </div>
                <div class="tab-pane fade" id="tab2Content3">
                    <p>
                    <form class="form-horizontal" id="userPwdForm">
                        <div class="form-group">
                            <label for="exampleInputAccount4" class="col-sm-2">当前密码</label>
                            <div class="col-md-6 col-sm-10">
                                <input type="password" class="form-control" id="passWord" placeholder="当前密码">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputPassword4" class="col-sm-2">新密码</label>
                            <div class="col-md-6 col-sm-10">
                                <input type="password" class="form-control" id="nPassWord" placeholder="新密码">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputPassword4" class="col-sm-2">确认密码</label>
                            <div class="col-md-6 col-sm-10">
                                <input type="password" class="form-control" id="rNPassWord" placeholder="确认密码">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="button" class="btn btn-primary">确认修改</button>
                            </div>
                        </div>
                    </form>
                    </p>
                </div>
            </div>
        </div>
    </div>
    <!-- 页脚 -->
    <#include "../../front/common/footer.ftl"/>
</div>
<script>
// 我的资料 确认修改
$('#userInfoButton').click(function () {
  $.post('/user/userInfoUpdate', {
    "id" : $("#id").val(),
    "name" : $("#name").val(),
    "phone" : $("#phone").val(),
    "email" : $("#email").val()
  }, function (result) {
        if (result.errorCode == 'y') {
            new $.zui.Messager('提示消息：' + result.errorText, {
                icon: 'exclamation-sign',
                type: 'success',
                time: 2000
            }).show();
            location.reload(true);
        } else {
            new $.zui.Messager('提示消息：' + result.errorText, {
                icon: 'exclamation-sign',
                type: 'danger',
                time: 2000
            }).show();
        }
  });
});
</script>
</body>
</html>